package cn.gson.crm.model.pojos;


import javax.persistence.*;

import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "Sell_", schema = "CRM", catalog = "")
public class Sell {
    private int sellId;
    private String sellName;
    private Date sellTime;
    private Long sellMoney;
    private String sellType;
    private String sellReimburse;
    private String sellApprover;
    private Long sellCondition;
    private Employee employeeByYgId;

    @Id
    @Column(name = "Sell_id")
    @GeneratedValue(generator  =  "seq",strategy  =  GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name  =  "seq",sequenceName  =  "crm",
            initialValue  =  1,allocationSize  =  1)
    public int getSellId() {
        return sellId;
    }

    public void setSellId(int sellId) {
        this.sellId = sellId;
    }

    @Basic
    @Column(name = "Sell_name")
    public String getSellName() {
        return sellName;
    }

    public void setSellName(String sellName) {
        this.sellName = sellName;
    }

    @Basic
    @Column(name = "Sell_time")
    public Date getSellTime() {
        return sellTime;
    }

    public void setSellTime(Date sellTime) {
        this.sellTime = sellTime;
    }

    @Basic
    @Column(name = "Sell_money")
    public Long getSellMoney() {
        return sellMoney;
    }

    public void setSellMoney(Long sellMoney) {
        this.sellMoney = sellMoney;
    }

    @Basic
    @Column(name = "Sell_type")
    public String getSellType() {
        return sellType;
    }

    public void setSellType(String sellType) {
        this.sellType = sellType;
    }

    @Basic
    @Column(name = "Sell_reimburse")
    public String getSellReimburse() {
        return sellReimburse;
    }

    public void setSellReimburse(String  sellReimburse) {
        this.sellReimburse = sellReimburse;
    }

    @Basic
    @Column(name = "Sell_approver")
    public String getSellApprover() {
        return sellApprover;
    }

    public void setSellApprover(String sellApprover) {
        this.sellApprover = sellApprover;
    }

    @Basic
    @Column(name = "Sell_condition")
    public Long getSellCondition() {
        return sellCondition;
    }

    public void setSellCondition(Long sellCondition) {
        this.sellCondition = sellCondition;
    }


    @ManyToOne()
    @JoinColumn(name = "yg_id", referencedColumnName = "yg_id")
    public Employee getEmployeeByYgId() {
        return employeeByYgId;
    }

    public void setEmployeeByYgId(Employee employeeByYgId) {
        this.employeeByYgId = employeeByYgId;
    }

    @Override
    public String toString() {
        return "Sell{" +
                "sellId=" + sellId +
                ", sellName='" + sellName + '\'' +
                ", sellTime=" + sellTime +
                ", sellMoney=" + sellMoney +
                ", sellType='" + sellType + '\'' +
                ", sellReimburse='" + sellReimburse + '\'' +
                ", sellApprover='" + sellApprover + '\'' +
                ", sellCondition=" + sellCondition +
                ", employeeByYgId=" + employeeByYgId +
                '}';
    }
}
